﻿//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1998-2024 Glodon Company Limited.
//
// Licensed under the MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the “Software”),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once

#include "GmStructure.h"
#include "GmIStructureFactory.h"

namespace gcmp
{
    class GmStructureFactory : public GmIStructureFactory
    {
        CANNOT_COPY_OR_ASSIGN(GmStructureFactory);
    public:
        GmStructureFactory();
        ~GmStructureFactory();

#pragma region Db
        virtual Guid GetClassGuidThroughBuiltInMethod(const IObject* pIObject) const override;
        virtual ISerializationBehavior * GetBuiltInSerializationBehavior(const IObject* pIObject) const override;
        virtual ICloneBehavior * GetBuiltInCloneBehavior(const IObject* pIObject) const override;
#pragma endregion Db

#pragma region Line Family
        virtual IGbmpLineFamilyInstance* CreateLineFamilyInstance(const LineFamilyInstanceInput* pInput, bool regenInstance) override;
#pragma endregion Line Family

#pragma region Basic Beam
        virtual IStructureBasicBeam* CreateBasicBeam(const StructureBeamInput* pInput) override;
        virtual IStructureBasicBeam* GetBasicBeam(IInstance* pInstance) override;
        virtual const IStructureBasicBeam* GetBasicBeam(const IInstance* pInstance) override;
#pragma endregion Basic Beam

#pragma region Variable Section Beam 
        virtual IStructureVariableSectionBeam* CreateVariableSectionBeam(const StructureBeamInput* pInput) override;
        virtual IStructureVariableSectionBeam* GetVariableSectionBeam(IInstance* pInstance) override;
        virtual const IStructureVariableSectionBeam* GetVariableSectionBeam(const IInstance* pInstance) override;
#pragma endregion Variable Section Beam 

#pragma region Basic Wall
        virtual IStructureBasicWall* CreateBasicWall(const StructureWallInput* pInput) override;
        virtual IStructureBasicWall* GetBasicWall(IInstance* pInstance) override;
        virtual const IStructureBasicWall* GetBasicWall(const IInstance* pInstance) override;
#pragma endregion Basic Wall

#pragma region Variable Section Wall
        virtual IStructureVariableSectionWall* CreateVariableSectionWall(const StructureWallInput* pInput) override;
        virtual IStructureVariableSectionWall* GetVariableSectionWall(IInstance* pInstance) override;
        virtual const IStructureVariableSectionWall* GetVariableSectionWall(const IInstance* pInstance) override;
#pragma endregion Variable Section Wall

#pragma region Vertical Column
        virtual IStructureVerticalColumn* CreateVerticalColumn(const StructureColumnInput* pInput) override;
        virtual IStructureVerticalColumn* GetVerticalColumn(IInstance* pInstance) override;
        virtual const IStructureVerticalColumn* GetVerticalColumn(const IInstance* pInstance) override;
#pragma endregion Vertical Column

#pragma region Slanted Column
        virtual IStructureSlantedColumn* CreateSlantedColumn(const StructureColumnInput* pInput) override;
        virtual IStructureSlantedColumn* GetSlantedColumn(IInstance* pInstance) override;
        virtual const IStructureSlantedColumn* GetSlantedColumn(const IInstance* pInstance) override;
#pragma endregion Slanted Column

#pragma region NewFloor
        virtual IStructureFloor* CreateStructureFloor(const StructureProfileInstanceGeometryInput* pInput) override;
        virtual IStructureFloor* EditStructureFloor(const StructureProfileInstanceEditGeometryInput* pInput) override;
        virtual IStructureFloor* CreateStructureFloor(const StructureProfileInstanceElementInput* pInput) override;
        virtual IStructureFloor* EditStructureFloor(const StructureProfileInstanceEditElementInput* pInput) override;

        virtual IStructureFloor* GetStructureFloor(IInstance* pInstance) override;
        virtual const IStructureFloor* GetStructureFloor(const IInstance* pInstance) override;
#pragma endregion NewFloor

#pragma region PlateHole
        virtual IStructurePlateHole* CreateStructurePlateHole(const StructurePlateHoleGeometryInput* pInput) override;
        virtual IStructurePlateHole* CreateStructurePlateHole(const StructurePlateHoleElementInput* pInput) override;
        virtual IStructurePlateHole* EditStructurePlateHole(const StructurePlateHoleEditGeometryInput* pInput) override;
        virtual IStructurePlateHole* EditStructurePlateHole(const StructurePlateHoleEditElementInput* pInput) override;
        virtual IStructurePlateHole* GetStructurePlateHole(IInstance* pInstance) override;
        virtual const IStructurePlateHole* GetStructurePlateHole(const IInstance* pInstance) override;
#pragma endregion PlateHole

#pragma region Foundation
        virtual IStructureRaftFoundation* CreateRaftFoundation(const StructureRaftFoundationGeometryInput* pInput) override;
        virtual IStructureRaftFoundation* EditRaftFoundation(const StructureProfileInstanceEditGeometryInput* pInput) override;
        virtual IStructureRaftFoundation* CreateRaftFoundation(const StructureRaftFoundationElementInput* pInput) override;
        virtual IStructureRaftFoundation* EditRaftFoundation(const StructureProfileInstanceEditElementInput* pInput) override;
        virtual IStructureRaftFoundation* GetRaftFoundation(IInstance* pInstance) override;
        virtual const IStructureRaftFoundation* GetRaftFoundation(const IInstance* pInstance) override;

        virtual IStructureStripFoundation* CreateStripFoundation(const StructureStripFoundationInput* pInput) override;
#pragma endregion Foundation

#pragma region Roof
        virtual IStructureRoof* CreateStructureRoof(const StructureRoofInput* pInput) override;
        virtual IStructureRoof* EditStructureRoof(const StructureRoofEditInput* pInput) override;
        virtual IStructureRoof* GetStructureRoof(IInstance* pInstance) override;
        virtual const IStructureRoof* GetStructureRoof(const IInstance* pInstance) override;
#pragma endregion Roof

#pragma region WallHole
        virtual IStructureWallHole* CreateWallHole(const StructureWallHoleInput* pInput) override;
#pragma endregion WallHole

#pragma region StructureInstanceBuildingStoreyData
        virtual IStructureInstanceBuildingStoreyData* CreateStructureInstanceBuildingStoreyData(IInstance* pInstance,ElementId buildingStoreyId) override;
        virtual IStructureInstanceBuildingStoreyData* GetStructureInstanceBuildingStoreyData(IInstance* pInstance) override;
        virtual const IStructureInstanceBuildingStoreyData* GetStructureInstanceBuildingStoreyData(const IInstance* pInstance) override;
#pragma endregion StructureInstanceBuildingStoreyData

#pragma region Join
        virtual OwnerPtr<IElementJoinBehavior> CreateInstanceJoinBehavior(IDocument* pDoc, JoinType joinType, bool isChangeJoinTypeAllowed) override;
#pragma endregion Join

    };
}
